package org.springblade.modules.admin.vo.platform;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author zcc
 * @version 1.0
 * @date 2022/5/30 9:47
 */
@Data
@ApiModel("平台电梯管理model")
public class ElevatorVo {

	private Long id;

	@ApiModelProperty("电梯地址")
	private String address;

	@ApiModelProperty("品牌名称")
	private String brandName;

	@ApiModelProperty("电梯编码")
	private String privateNum;

	/**
	 * 来源类型 0-平台, 1-维保租户, 2-物业租户
	 */
	@ApiModelProperty("创建来源类型")
	private Integer sourceType;

	@ApiModelProperty("创建来源名称")
	private String sourceTypeName;

	@ApiModelProperty("创建租户号")
	private String sourceTenantId;

	@ApiModelProperty("创建租户名称")
	private String sourceTenantName;

	@ApiModelProperty("创建人")
	private String sourceUserName;

	@ApiModelProperty("创建时间")
	private String createTime;


	@ApiModelProperty("最后更新来源类型")
	private Integer updateSourceType;

	@ApiModelProperty("最后更新来源名称")
	private String updateSourceTypeName;

	@ApiModelProperty("最后更新租户号")
	private String updateTenantId;

	@ApiModelProperty("最后更新租户名称")
	private String updateTenantName;

	@ApiModelProperty("更新人")
	private String updateUserName;

	@ApiModelProperty("最后更新时间")
	private String updateTime;

	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
		if (sourceType != null) {
			if (sourceType == 0) {
				this.sourceTypeName = "平台";
			} else if (sourceType == 1) {
				this.sourceTypeName = "维保租户";
			} else if (sourceType == 2) {
				this.sourceTypeName = "物业租户";
			}
		}
	}

	public void setUpdateSourceType(Integer updateSourceType) {
		this.updateSourceType = updateSourceType;

		if (updateSourceType == null || updateSourceType == 000000) {
			this.updateSourceTypeName = "平台";
		} else if (updateSourceType == 1) {
			this.updateSourceTypeName = "维保租户";
		} else if (updateSourceType == 2) {
			this.updateSourceTypeName = "物业租户";
		}
	}
}
